1) Field of the Invention
The present invention relates to a memory control circuit that prevents write errors in a rewritable memory, a memory device employing the memory control circuit, and a microcomputer equipped with the memory device.
2) Description of the Related Art
Normally in a memory in which data can be rewritten, stored data may be rewritten due to a noise or a momentary power failure. Therefore, in a nonvolatile memory such as a flash memory, a measure has heretofore been taken to prevent accidental rewrite of data due to such a malfunction. Even in a volatile memory such as a random access memory (RAM), it is necessary to prevent accidental rewrite of data due to a noise or the like.
Conventionally in products such as a microcomputer equipped with a nonvolatile memory, write errors are prevented by providing a security function circuit in the nonvolatile memory itself. However, there is a problem in that the circuit size of the nonvolatile memory increases by the security function circuit. Therefore, as a technique for preventing write errors without increasing the circuit size of the nonvolatile memory itself, it is proposed to provide a write enable register in a control circuit that controls an access to the nonvolatile memory, so that write into the nonvolatile memory is disabled or enabled by changing setting of the register. There is also a flash memory in which a storage area indicating write enable or disable of data with respect to a memory cell array is provided (for example, see Japanese Patent Application Laid-open No. H11-120781).
Conventionally, however, the write enable register can be freely rewritten, that is, there is no restriction in disabling or enabling write into the nonvolatile memory. Therefore, there is a problem in that it is insufficient as a measure for preventing write errors at the time of abnormal operation due to a noise or a momentary power failure.